﻿<Window x:Class="DTC.Popups.PatientDrugPrescriptionListPopup"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Converters="clr-namespace:DTC.Converters"
        Title="Назначенные препараты" Style="{StaticResource PopupWindow}" Height="700" Width="600"
        Closing="Window_Closing">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/ButtonsStyles.xaml"/>
				<ResourceDictionary Source="../Resources/BorderStyles.xaml"/>
                <ResourceDictionary Source="../Resources/Brushes.xaml"/>
                <ResourceDictionary Source="../Resources/ListBoxStyles.xaml"/>
                <ResourceDictionary Source="../Resources/TextBlockStyles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <Grid Margin="25">
        <Grid.RowDefinitions>
			<RowDefinition Height="21"/>
            <RowDefinition Height="*"/>
            <!--<RowDefinition Height="0.7*"/>
			<RowDefinition Height="35"/>
            <RowDefinition Height="0.3*"/>-->
        </Grid.RowDefinitions>
		<TextBlock Text="Назначения:"
					Grid.Row="0"
					VerticalAlignment="Top"
					HorizontalAlignment="Center"/>
        <ListBox Name="DrugPrescriptionsListBox"
                 Grid.Row="1"
				 ItemContainerStyle="{StaticResource ColorListBoxItem}"
				 HorizontalContentAlignment="Stretch">
				 <ListBox.ItemTemplate>
                	<DataTemplate>
                    <Grid Margin="5,0,0,0" VerticalAlignment="Center" Height="100">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="0.3*" />
                            <ColumnDefinition Width="0.3*" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="10"/>
                        </Grid.ColumnDefinitions>
						 <Border BorderBrush="#FFCAD1FF" 
									BorderThickness="1" CornerRadius="3"
									Grid.Column="0" Grid.RowSpan="4" 
									Margin="4,4,2,4">
							<StackPanel HorizontalAlignment="Center"
										VerticalAlignment="Center">
								<TextBlock Text="Название препарата:"
											Foreground="Gray"
											FontSize="10"
											Margin="5,0,5,0"
											HorizontalAlignment="Center"
											VerticalAlignment="Center"/>
                        		<TextBlock VerticalAlignment="Center"
											HorizontalAlignment="Center"
                                       		FontSize="14"
                                       		FontWeight="Bold"
                                            Margin="5,0,5,0"
                                       		Text="{Binding DrugName}"/>
							</StackPanel>
						</Border>
						<StackPanel Grid.Column="1"
									HorizontalAlignment="Center"
									VerticalAlignment="Stretch"
                                    Margin="2,4,2,4">
							<Border BorderBrush="#FFCAD1FF" 
									BorderThickness="1" CornerRadius="3"
									Margin="0,0,0,2"
                                    Height="44">
								<StackPanel HorizontalAlignment="Center"
											VerticalAlignment="Center">
                           				<TextBlock Text="Дата начала курса: "
													Foreground="Gray"
													FontSize="10"
													Margin="5,0,5,0"
													HorizontalAlignment="Center"
													VerticalAlignment="Center"/>
                            			<TextBlock HorizontalAlignment="Center"
                                                   VerticalAlignment="Center"
                                                   Margin="5,0,5,0"
                                                   FontSize="12">
                                    		<TextBlock.Text>
	                                        	<Binding Path="CourseStartDate" Mode="OneWay">
    	                                        	<Binding.Converter>
        	                                        	<Converters:DateTimeToDateConverter></Converters:DateTimeToDateConverter>
            	                                	</Binding.Converter>
                	                        	</Binding>
                    	                	</TextBlock.Text>
                        	    		</TextBlock>
								</StackPanel>
							</Border>
							<Border BorderBrush="#FFCAD1FF" 
									BorderThickness="1" CornerRadius="3"
									Margin="0,2,0,0"
                                    Height="44">
								<StackPanel HorizontalAlignment="Center"
											VerticalAlignment="Center">
                           				<TextBlock Text="Форма выпуска: "
													Foreground="Gray"
													FontSize="10"
													Margin="5,0,5,0"
													HorizontalAlignment="Center"
													VerticalAlignment="Center"/>
                            			<TextBlock HorizontalAlignment="Center"
                                                   VerticalAlignment="Center"
                                                   Margin="5,0,5,0"
                                                   FontSize="12"
                                                   Text="{Binding IssueFormName}"/>
								</StackPanel>
							</Border>
						</StackPanel>
						<StackPanel Grid.Column="2" VerticalAlignment="Stretch">
							<Border BorderBrush="#FFCAD1FF" 
									BorderThickness="1" CornerRadius="3"
									Grid.Column="1" Grid.RowSpan="4" 
									Margin="2,4,4,2" Height="28">
									<WrapPanel HorizontalAlignment="Center"
												VerticalAlignment="Center">
												<TextBlock Text="Суточная доза: "
												Foreground="Gray"
												FontSize="10"
												Margin="5,0,5,0"
												HorizontalAlignment="Center"
												VerticalAlignment="Center"/>
                            			<TextBlock HorizontalAlignment="Center"
                                                   VerticalAlignment="Center"
                                                   Margin="5,0,5,0"
                                                   FontSize="11"
                                                   Text="{Binding FormatedDose}"/>
									</WrapPanel>
							</Border>
							<Border BorderBrush="#FFCAD1FF" 
									BorderThickness="1" CornerRadius="3"
									Grid.Column="1" Grid.RowSpan="4" 
									Margin="2,2,4,2" Height="28">
									<WrapPanel HorizontalAlignment="Center"
												VerticalAlignment="Center">
												<TextBlock Text="Ритм введения: "
												Foreground="Gray"
												FontSize="10"
												Margin="5,0,5,0"
												HorizontalAlignment="Center"
												VerticalAlignment="Center"/>
                            			<TextBlock HorizontalAlignment="Center"
                                                   VerticalAlignment="Center"
                                                   Margin="5,0,5,0"
                                                   FontSize="11"
                                                   Text="{Binding FormatedFreqOfUse}"/>
									</WrapPanel>
							</Border>
                            <Border BorderBrush="#FFCAD1FF" 
									BorderThickness="1" CornerRadius="3"
									Grid.Column="1" Grid.RowSpan="4" 
									Margin="2,2,4,4" Height="28">
                                <WrapPanel HorizontalAlignment="Center"
												VerticalAlignment="Center">
                                    <TextBlock Text="Расчет назначения: "
												Foreground="Gray"
												FontSize="10"
												Margin="5,0,5,0"/>
                                    <Button Name="CalculateNeed"
											Style="{StaticResource ListBoxInlineButton}"
											Height="15"
											Width="15"
                                            HorizontalAlignment="Left"
                                            VerticalAlignment="Center"
                                            Margin="5,0,0,0"
                                            Click="CalculateNeed_Click"
                                            Tag="{Binding}">
                                        <Button.ToolTip>
                                            Расчитать потребность
                                        </Button.ToolTip>
                                    </Button>
                                </WrapPanel>
                            </Border>
						</StackPanel>
                        <Button Name="DeletePresButton"
									Grid.Column="3"
									Grid.Row="1"
									Height="44"
									Width="9"
									Margin="2,0,0,0"
									Style="{StaticResource DelRecButton}"
									HorizontalAlignment="Right"
									VerticalAlignment="Bottom"
                                    Click="DeletePresButton_Click"
                                    Tag="{Binding}">
									<Button.ToolTip>
									<ToolTip Style="{StaticResource DefaultToolTipStyle}"
												Height="33"
												Width="75"
												VerticalOffset="-27">
											<TextBlock Text="Удалить"/>
									</ToolTip>
								</Button.ToolTip>
							</Button>
							<Button Name="ViewPrescButton"
									Grid.Column="3"
									Grid.Row="0"
									Height="44"
									Width="9"
									Margin="2,0,0,0"
									Style="{StaticResource ViewRecButton}"
									HorizontalAlignment="Right"
									VerticalAlignment="Top"
                                    Click="ViewPrescButton_Click"
                                    Tag="{Binding}">
									<Button.ToolTip>
									<ToolTip Style="{StaticResource DefaultToolTipStyle}"
												Height="33"
												Width="75"
												VerticalOffset="-27">
											<TextBlock Text="Изменить"/>
									</ToolTip>
								</Button.ToolTip>
							</Button>
                    </Grid>
                </DataTemplate>
				</ListBox.ItemTemplate>
			</ListBox>
		<Border Grid.Row="1"
				Style="{StaticResource ListBoxControlPanel}"
				Margin="1,1,0,1"
				Width="25"
				VerticalAlignment="Stretch" HorizontalAlignment="Left">
			<Button Name="NewPrescriptionButton" 
                HorizontalAlignment="Center" 
                VerticalAlignment="Top"
                Height="18" Width="18"
				Margin="0,5,0,0"
                Style="{StaticResource AddRecButton}"
                    Click="NewPrescriptionButton_Click"/>
		</Border>
		<TextBlock Text="Выдачи:"
					Grid.Row="2"
					VerticalAlignment="Center"
					HorizontalAlignment="Center"
                   Visibility="Collapsed"/>
        <ListBox Name="DrugIssuesListBox"
                 Grid.Row="3"
                 Margin="0,0,0,0"
                 ItemContainerStyle="{StaticResource ColorListBoxItem}" 
                 HorizontalContentAlignment="Stretch"
                 Visibility="Collapsed">
        </ListBox>
       <Border Grid.Row="3"
				Style="{StaticResource ListBoxControlPanel}"
				Margin="1,1,0,1"
				Width="25"
				VerticalAlignment="Stretch" HorizontalAlignment="Left"
               Visibility="Collapsed">
			<Button Name="NewDrugIssueButton" 
                    HorizontalAlignment="Center" 
                    VerticalAlignment="Top"
                    Height="18" Width="18"
                    Margin="0,5,0,0"
                    Style="{StaticResource AddRecButton}"
                    Click="NewDrugIssueButton_Click"/>
		</Border>
    </Grid>
</Window>
